# -*- coding: utf-8 -*-
'''
    date:2017-05-25  hqk
    parse dianping restinfo, pic 
   
'''

import urllib2
import lxml import etree

HASHCODE = 1 << 24

class ParseDianp(object):
    def __init__(self):
        pass
    
    @staticmethod
    def get_restinfo(mainobj):
        pass
    
    @staticmethod
    def get_restpic(picobj):
        pass

    @staticmethod
    def get_thread(mainobj):
        pass


    #抓取端存取图片名字的hashcode 节省占用空间
    @staticmethod
    def pic_hash(picName):
        return hash(picName) % HASHCODE
        
    
    @staticmethod
    def is_closed_rest(page):
        if '暂停营业' in page:
            return True
        else:
            return False

    

class parseMainPage(self):
    def __init__(self, page):
        self.html = etree.HTML(page)
    
    def get_rest_info(self):
        pass
    
    def get_recomm_food(self):
        pass
    
    def get_thread(self):
        pass
    
    def pic_url(slef):
        pass
  
class parsePicPage(self):
    def __init__(self, page):
        self.html = etree.HTML(page)
    
    def get_pic(self):
        pass
